import request from '@/utils/request'
import { encryptionData } from '@/utils/com'
import Qs from 'qs'
/* 修改/审核新品现货产品 */
export function editnewProductsMaterials(data) {
  return request({
    url: '/jcdGys/newProductsMaterials/edit',
    method: 'put',
    headers: encryptionData(data, '/newProductsMaterials/edit'),
    data: Qs.stringify(data)
  })
}
/* 分页获取团购邀请列表 */
export function groupPurchaseInvites(data) {
  return request({
    url: '/jcdGys/groupPurchaseInvites/page',
    method: 'get',
    headers: encryptionData(data, '/groupPurchaseInvites/page'),
    params: data
  })
}
/* 分页获取团购报名列表 */
export function groupPurchaseSignUppage(data) {
  return request({
    url: 'jcdGys/groupPurchaseSignUp/page',
    method: 'get',
    headers: encryptionData(data, '/jcdGys/groupPurchaseSignUp/page'),
    params: data
  })
}
/* 获取团购邀请详情信息 */
export function groupPurchaseInvitesGet(data) {
  return request({
    url: `jcdGys/groupPurchaseInvites/get/${data.id}`,
    method: 'get',
    headers: encryptionData(data, `groupPurchaseInvites/get/$\{id}`),
    params: data
  })
}
/* 分页查询新品现货活动主材 */
export function newProductsMaterialspage(data) {
  return request({
    url: '/jcdGys/newProductsMaterials/page',
    method: 'get',
    headers: encryptionData(data, '/newProductsMaterials/page'),
    params: data
  })
}


/***---------------------------------------------------------*****/
/* 清仓处理-列表 */
export function getClearanceList(data) {
  return request({
    url: '/jcdGys/clearanceActivities/page',
    method: 'get',
    headers: encryptionData(data, '/clearanceActivities/page'),
    params: data
  })
}

/* 清仓处理-删除 */
export function deleteClearance(data) {
  return request({
    url: '/jcdGys/clearanceActivities/delete',
    method: 'DELETE',
    headers: encryptionData(data, '/clearanceActivities/delete'),
    data: Qs.stringify(data)
  })
}


/* 清仓处理-详情 */
export function getClearanceDetail(data) {
  return request({
    url: '/jcdGys/getClearanceDetail',
    method: 'get',
    headers: encryptionData(data, '/getClearanceDetail'),
    params: data
  })
}

/* 清仓处理-保存 */
export function saveClearance(data) {
  return request({
    url: '/jcdGys/clearanceActivities/editActivitiesMater',
    method: 'put',
    headers: encryptionData(data, '/clearanceActivities/editActivitiesMater'),
    data: Qs.stringify(data)
  })
}


/* 特惠活动-列表 */
export function getDiscountsList(data) {
  return request({
    url: '/jcdGys/jcdPromotionalActivities/page',
    method: 'get',
    headers: encryptionData(data, '/jcdPromotionalActivities/page'),
    params: data
  })
}

/* 特惠活动-删除 */
export function deleteDiscounts(data) {
  return request({
    url: '/jcdGys/jcdPromotionalActivities/delById',
    method: 'DELETE',
    headers: encryptionData(data, '/jcdPromotionalActivities/delById'),
    data: Qs.stringify(data)
  })
}


/* 特惠活动-详情 */
export function getDiscountsDetail(data) {
  return request({
    url: '/jcdGys/jcdPromotionalActivities/getById',
    method: 'get',
    headers: encryptionData(data, '/jcdPromotionalActivities/getById'),
    params: data
  })
}

/* 特惠活动-保存 */
export function saveDiscounts(data) {
  return request({
    url: '/jcdGys/jcdPromotionalActivities/save',
    method: 'post',
    headers: encryptionData(data, '/jcdPromotionalActivities/save'),
    data: Qs.stringify(data)
  })
}


/* 特惠活动-报名-列表 */
export function getDiscountsSignList(data) {
  return request({
    url: '/jcdGys/jcdPromotionalMaterials/page',
    method: 'get',
    headers: encryptionData(data, '/jcdPromotionalMaterials/page'),
    params: data
  })
}

/* 特惠活动-报名-删除 */
export function deleteDiscountsSign(data) {
  return request({
    url: '/jcdGys/jcdPromotionalMaterials/delMaterials',
    method: 'DELETE',
    headers: encryptionData(data, '/jcdPromotionalMaterials/delMaterials'),
    data: Qs.stringify(data)
  })
}

/* 特惠活动-报名-保存 */
export function saveDiscountsSign(data) {
  return request({
    url: '/jcdGys/jcdPromotionalMaterials/updMaterials',
    method: 'post',
    headers: encryptionData(data, '/jcdPromotionalMaterials/updMaterials'),
    data: Qs.stringify(data)
  })
}

/* 特惠活动-报名-sku信息-列表 */
export function getDiscountsSignSkuList(data) {
  return request({
    url: '/jcdGys/jcdPromotionalMaterialsSku/list',
    method: 'get',
    headers: encryptionData(data, '/jcdPromotionalMaterialsSku/list'),
    params: data
  })
}
/* 新品现货-sku信息-列表 */
export function jcdMaterialsSkuList(data) {
  return request({
    url: '/jcdGys/jcdMaterialsSku/getList',
    method: 'get',
    headers: encryptionData(data, '/jcdMaterialsSku/getList'),
    params: data
  })
}

/* 特惠活动-报名-sku信息-保存 */
export function saveDiscountsSignSkuList(data) {
  return request({
    url: '/jcdGys/jcdPromotionalMaterialsSku/update',
    method: 'post',
    headers: encryptionData(data, '/jcdPromotionalMaterialsSku/update'),
    data: Qs.stringify(data)
  })
}

/* 特惠活动-报名-保存（审核、排序号） */
export function saveDiscountsSignList(data) {
  return request({
    url: '/jcdGys/jcdPromotionalMaterials/updMaterials',
    method: 'post',
    headers: encryptionData(data, '/jcdPromotionalMaterials/updMaterials'),
    data: Qs.stringify(data)
  })
}
